<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>店主列表</title>
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<link rel="stylesheet" type="text/css" href="../static/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="../static/common/bootstrap/css/bootstrap.css" media="all">
	<link rel="stylesheet" type="text/css" href="../static/common/global.css" media="all">
	<link rel="stylesheet" type="text/css" href="../static/css/personal.css" media="all">
</head>
<body>  
<section class="layui-larry-box">

	<form class="form-inline" role="form" action="/bsc/shop/listuser" method="post">
	 <input type="hidden" id="shopid" >
            <blockquote class="layui-elem-quote news_search">
  <div class="form-group">
   店主帐户:
    <input type="text" class="form-control" name="account" id="account" placeholder="请输入店主帐户"  value="${map.account }">
  </div>
   <div class="form-group">
   姓名:
    <input type="text" class="form-control" name="username" id="username" placeholder="请输入姓名" value="${map.username }">
  </div>
  状态:
  <select class="form-control" name="status" id="status">
  <option value="-1">请选择</option>
  <option value="0">停用</option>
  <option value="1">启用</option>
</select> <br>
   <div class="form-group">
    手机:
    <input type="text" class="form-control" name="mobile" id="mobile" placeholder="请输入手机" value="${map.mobile }">
  </div>
    <div class="form-group">
   身份证:
    <input type="text" class="form-control" name="idno" id="idno" placeholder="请输入身份证" value="${map.idno }">
  </div>
  
  <button type="submit"   class="layui-btn layui-btn-normal">查询</button>
 <div class="layui-inline">
  <a class="layui-btn layui-btn-normal " href="/bsc/shop/add">新增店主</a>
</div>
<!--  <button type="button"  onclick="alter()"  class="layui-btn layui-btn-normal">修改密码</button>  -->
<button type="button"  onclick="redact()"  class="layui-btn layui-btn-normal">编辑</button>
<button type="button"  onclick="de()"  class="layui-btn layui-btn-normal">删除</button>
<button type="button"  onclick="cz()"  class="layui-btn layui-btn-normal">重置</button>
	</blockquote>
		         <!-- 操作日志 -->
                <div class="layui-form news_list">
                    <table class="layui-table" >
					    <colgroup>
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="9%">
						<col width="15%">
					</colgroup>
					<thead>
						<tr>
							<th style="text-align:left;">编号</th>
							<th>店主帐户</th>
							<th>姓名</th>
							<th>性别</th>
							<th>手机</th>
							<th>身份证</th>
							<th>邮箱</th>
							<th>电话</th>
							<th>状态</th>
							<th>创建时间</th>
						</tr>
					</thead>
					<tbody class="news_content" id="tb" >
						<c:forEach items="${info.list }" var="user" varStatus="s">
						<tr>
							<td align="left">${s.index+1 }</td>
							<td style="display:none">${user.shop_user_id }</td>
							<td>${user.account }</td>
 							<td>${user.username }</td>
 							<td>
 							<c:if test="${user.sex=='0' }">保密</c:if>
 							<c:if test="${user.sex=='1' }">男</c:if>
 							<c:if test="${user.sex=='2' }">女</c:if>
 							</td>
 							<td>${user.mobile }</td>
 							<td>${user.idno }</td>
 							<td>${user.email }</td>
 							<td>${user.phone }</td>
 							<td>
 							<c:if test="${user.status=='0' }">禁用</c:if>
 							<c:if test="${user.status=='1' }">启用</c:if>
 							</td>
 							<td>
 							<fmt:formatDate value="${user.create_time }" pattern="yyyy-MM-dd"/>
 							</td>
						</tr>
						</c:forEach>
					</tbody>
					</table>
                     
		</div>
		<a class="layui-btn layui-btn-normal" href="#" onclick="up()">上一页</a> <a class="layui-btn layui-btn-normal" href="#" onclick="next()" >下一页</a>
	  </form> 
</section>

<script type="text/javascript" src="../static/common/layui/layui.js"></script>
<!--  <script type="text/javascript" src="../static/js/newslist.js"></script> -->
<script type="text/javascript" src="/bsc/static/js/jquery-1.7.1.js"></script>
<script type="text/javascript">
$(function(){
	
 	  //下拉框定值
 	 $("#status").val(${map.status}); 
 	  //点击表格变色
 	$("#tb tr").click(function(){
		$(this).css("background","#DCDCDC").siblings().css("background","white");
		var tdval=$(this).children("td:eq(1)").text();
		$("#shopid").val(tdval)
		})
 	 
 	  
 	  
     });
 //修改密码	  
 function alter(){
	 if($("#shopid").val()==""){
		 alert("选择一个店主")
	 }else{
		     document.forms[0].action="/bsc/shop/editpas/"+$("#shopid").val();
			document.forms[0].submit();
	 }
      
 }
 //编辑
 function redact(){
	 if($("#shopid").val()==""){
		 alert("选择一个店主")
	 }else{
		     document.forms[0].action="/bsc/shop/edit/"+$("#shopid").val();
			document.forms[0].submit();
	 }
      
 }
 //删除
function de(){
	 if($("#shopid").val()==""){
		 alert("选择一个店主")
	 }else{
		  if(window.confirm("你确定删除吗?")){
			  document.forms[0].action="/bsc/shop/delete/"+$("#shopid").val();
				document.forms[0].submit(); 
		  }
	 }
      
 }
//上一页
function up(){
	document.forms[0].action="/bsc/shop/listuser?page="+${info.prePage};
	document.forms[0].submit();
};
//下一页
function next(){
	document.forms[0].action="/bsc/shop/listuser?page="+${info.nextPage};
	document.forms[0].submit();
};
 //重置   
function cz(){
	$("#account").val("");
	$("#username").val("");
	$("#status").val("-1");
	$("#mobile").val("");
	$("#idno").val("");
	
 }	
</script>
</body>
</html>